package com.cuddleclones.imgdepot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cuddleclones.imgdepot.model.Bodypos;
import com.cuddleclones.imgdepot.mapper.BodyposMapper;
import com.cuddleclones.imgdepot.service.BodyposService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhoushuang
 * @since 2021-07-04
 */
@Service
@Transactional
public class BodyposServiceImpl extends ServiceImpl<BodyposMapper, Bodypos> implements BodyposService {

    @Autowired
    private BodyposMapper bodyposMapper;

    @Override
    public IPage<Bodypos> selectPage(Page<Bodypos> page, Bodypos bodypos) {
        QueryWrapper<Bodypos> queryWrapper = new QueryWrapper<Bodypos>();
        getQueryWrapper(queryWrapper,bodypos);
        return bodyposMapper.selectPage(page,queryWrapper);
    }

    @Override
    public List<Bodypos> selectList(Bodypos bodypos) {
        QueryWrapper<Bodypos> queryWrapper = new QueryWrapper<Bodypos>();
        getQueryWrapper(queryWrapper,bodypos);
        return bodyposMapper.selectList(queryWrapper);
    }

    /**
     *  公共查询条件
     * @param queryWrapper
     * @return
     */
    public QueryWrapper<Bodypos> getQueryWrapper(QueryWrapper<Bodypos> queryWrapper,Bodypos bodypos){
        //条件拼接
    
        return queryWrapper;
    }
}
